package com.etc.util;
//分页工具类

import java.util.List;

public class PageTool<T> {

	private int pageIndex;//当前页码
	private int totalPage;//总页数
	private int totalCount;//总记录数
	private int pageSize;//页面容量
	private List<T> list;
	@Override
	public String toString() {
		return "PageTool [pageIndex=" + pageIndex + ", totalPage=" + totalPage + ", totalCount=" + totalCount
				+ ", pageSize=" + pageSize + ", list=" + list + "]";
	}
	public int getPageIndex() {
		return pageIndex;
	}
	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex;
	}
	public int getTotalPage() {
		return totalPage;
	}
	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}
	public int getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
		this.totalPage = totalCount%pageSize==0?totalCount/pageSize:totalCount/pageSize+1;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public List<T> getList() {
		return list;
	}
	public void setList(List<T> list) {
		this.list = list;
	}
	public PageTool(int pageIndex, int totalPage, int totalCount, int pageSize, List<T> list) {
		super();
		this.pageIndex = pageIndex;
		this.totalPage = totalPage;
		this.totalCount = totalCount;
		this.pageSize = pageSize;
		this.list = list;
	}
	public PageTool() {
		super();
	}


}
